package com.bookshop.mapper;

import com.bookshop.entity.Book;
import com.bookshop.entity.ClassifyList;
import com.bookshop.entity.SecondaryCategory;
import com.bookshop.entity.SimpleClassify;
import com.bookshop.entity.request.SearchForm;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * ClassName: BookMapper
 * Package: com.bookshop.mapper
 * Description:
 *
 * @Author BJX
 * @Create 2024/1/18 9:41
 * @Version 1.0
 */
@Mapper
public interface BookMapper {
    Book selectBookById(long id);
    List<Book> selectBookByKey(SearchForm s);

    //List<SecondaryCategory> selectSecondaryId(int classify);
    //List<Book> selectBookBySecondary(int classify);

    List<Integer> getAllFirstClassify();
    List<Integer> selectSecondaryId(int classify);
    List<Book> selectBookBySecondary(int classify);

    List<ClassifyList> getClassify();
    List<String> selectSecondaryName(int classify);

    List<SimpleClassify> getSimpleClassify();
    List<SimpleClassify> getPressClassify();

    double getBookPrice(@Param("bookId") String bookId);
}
